package com.athl.demoreactor.reactor8;

import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Stream;

/**
 * @author hl
 * @Data 2020/9/16
 */
public class TestReactor {

    public static void main(String[] args) {
        // just方法直接声明
        Flux.just(1, 2, 3, 4);
        Mono.just(5);
        // other
        Integer[] array = {1, 2, 3, 4};
        Flux.fromArray(array);
        List<Integer> list = Arrays.asList(array);
        Flux.fromIterable(list);
        Stream<Integer> stream = list.stream();
        Flux.fromStream(stream).subscribe(System.out::println);
    }
}
